<?php

class Database_ConnectionFactory
{

    private static $factory;
    
    private $db;

    public static function getFactory()
    {
        if (!self::$factory)
        {
            self::$factory = new Database_ConnectionFactory();
        }

        return self::$factory;

    }

    public function getConnection($type, $database, $username = NULL, $password = NULL, $host = NULL, $port = NULL, $timeout = NULL)
    {

        if (!$this->db)
        {
            $this->db = new Database_sDB($type, $database, $username, $password, $host, $port, $timeout);
        }

        return $this->db;

    }

}